package com.hy.ssm.vo;

import java.util.Objects;

/**值对象 工具
 * @Auther: HuYang
 * @Date: 2022/11/23 - 11 - 23 - 19:25
 * @Description: com.hy.ssm.vo
 * @version: 1.0
 */
public class ResultVO {
    private Integer code;//响应码
    private String msg;//响应信息
    private Object data;//我要返回的数据

    public ResultVO() {

    }

    public ResultVO(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public ResultVO(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ResultVO(Integer code, Object data) {
        this.code = code;
        this.data = data;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ResultVO)) return false;
        ResultVO resultVO = (ResultVO) o;
        return Objects.equals(code, resultVO.code) && Objects.equals(msg, resultVO.msg) && Objects.equals(data, resultVO.data);
    }

    @Override
    public int hashCode() {
        return Objects.hash(code, msg, data);
    }

    @Override
    public String toString() {
        return "ResultVO{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
